﻿#ifndef SERIALPORTREQUESTER_H
#define SERIALPORTREQUESTER_H
#include <QObject>
#include <QSerialPort>

#include "myhead.h"
#include "baserequester.h"
#include "serialportwrap.h"

class SerialPortRequester : public BaseRequester
{
    Q_OBJECT
public:
    Q_INVOKABLE explicit SerialPortRequester(QObject *parent = nullptr);
    virtual ~SerialPortRequester();

public:
    virtual bool connectToHost() override;
    virtual bool isConnected() override;
    virtual bool disConnect() override;

    virtual QByteArray request(QByteArray data) override;

    virtual bool requestNoReply(QByteArray data) override;

signals:

public slots:

private:
    QSerialPort *m_serialPort=nullptr;
    SerialPortWrap *m_wrap=nullptr;

public:
    virtual QWidget *getConfigWidget() override;
};

#endif // SERIALPORTREQUESTER_H
